﻿@{
    Layout = null;
}

<!DOCTYPE html>
@model EnterpriseFund.Model.AllowanceApplicationForm
<html>
<head>
    <title>AllowanceApplicationFormFrontEdit</title>
     @if (false)
       {
        <script src="../../Scripts/jquery-vsdoc.js" type="text/javascript"></script>
        <script src="../../Scripts/ASPxScriptIntelliSense.js" type="text/javascript"></script>
       }
    <link href="@Url.Content("~/Content/Site.css", true)" rel="stylesheet" type="text/css" />

    <link href="@Url.Content("~/Content/jquery-ui.css", true)" rel="stylesheet" type="text/css" />

    <script src="@Url.Content("~/Scripts/jquery.min.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/jquery-ui.min.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/FloatDiv.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/regex.js", true)" type="text/javascript"></script>

      <script src="@Url.Content("~/Scripts/json2.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Common/GetRootPath.ashx", true)" type="text/javascript"></script>

    @Html.DevExpress().GetStyleSheets(

        new StyleSheet { ExtensionType = ExtensionType.ListBox, Theme = DevExpressHelper.Theme }
)
    @Html.DevExpress().GetScripts(
        new Script { ExtensionType = ExtensionType.ListBox }
)
    <script>

        $(document).ready(function () {
            $("#toolMenu").smartFloat();
            var hdjsAlert = $("#hdjsAlert").val();
            if (hdjsAlert != "") {
                alert(hdjsAlert);
            }
            if (hdjsAlert == "操作成功") {

                //ASPxClientReportViewer.Cast("reportViewer1").Print();
                // reportViewer1.Print();
                window.location.href = rootPath + '/AllowanceApplicationFormFront/AllowanceApplicationFormFrontPrint?FApplicationFormID=' + $("#hdFApplicationFormID").val() + '&isshowje=' + $("#hidisshowje").val();
            }
            //alert($("#hidNSRDZDAH2").val());
            ASPxClientComboBox.Cast("comboBox").SetValue($("#hidNSRDZDAH2").val());
            Changed();
            ASPxClientComboBox.Cast("comboBox").SetText($("#hidNSRDZDAH3").val());
        });


        function OnBeginCallback(s, e) {
            e.customArgs["FApplicationFormID"] = $("#hdFApplicationFormID").val();
        }


        function YHChanged() {
            ASPxClientLabel.Cast("YHZK").SetText(KHYH.GetValue())
        }

        function FileChanged() {
            var name = FFileNo.GetValue();
            var list = name.split("|");
            FFinancePropName.SetText(list[3]);
            FNote.SetText(list[2]);

            $.ajax({
                type: 'POST',
                url: rootPath + '/AllowanceApplicationFormFront/GetJe',
                data: { FSource: list[1], FAllowanceFileID: list[0] ,NSRDZDAH: $("#hidNSRDZDAH").val()},
                success: function (result) {
                    var result2 = result.split("|");
                    FApplyAmount.SetText(result2[0]);
                    FApplyAmountDX.SetText(result2[1]);
                    FAuditAmount.SetText(result2[0]);
                    FAuditAmountDX.SetText(result2[1]);
                    $("#hidisshowje").val("false");
                    $("#hidFApplyAmount").val(result2[0]);
                    $("#hidFAuditAmount").val(result2[0]);
                }
            });
        }


        function MenuTop_emClick(source, e) {
            switch (e.item.name) {
                case "btnSubmit":
                    {
                        Save();
                        break;
                    }
                case "btnEdit":
                    {
                        FAuditAmount.SetText("");
                        FAuditAmountDX.SetText("");
                        $("#hidisshowje").val("true");
                        break;
                    }
                case "btnback":
                    {
                        window.location.href = rootPath + '/AllowanceApplicationFormFront/';
                        break;
                    }
            }

        }

        function Save() {
            form1.submit();
        }

        function Changed() {
            $("#hidNSRDZDAH").val(ASPxClientComboBox.Cast("comboBox").GetValue());
            $.ajax({
                type: 'POST',
                url: rootPath + '/AllowanceApplicationFormFront/GetDJ_YHXXList',
                data: { NSRDZDAH: ASPxClientComboBox.Cast("comboBox").GetValue() },
                success: function (result) {
                    ASPxClientComboBox.Cast("KHYH").ClearItems()
                    var List = JSON.parse(result);
                    for (var i = 0; i < List.length; i++) {
                        ASPxClientComboBox.Cast("KHYH").AddItem(List[i].YH_MC, List[i].YHZH, "");
                    }
                }
            });

            $.ajax({
                type: 'POST',
                url: rootPath + '/AllowanceApplicationFormFront/GetAllowanceFileList',
                data: { NSRDZDAH: ASPxClientComboBox.Cast("comboBox").GetValue() },
                success: function (result) {
                    ASPxClientComboBox.Cast("FFileNo").ClearItems()
                    var List = JSON.parse(result);
                    for (var i = 0; i < List.length; i++) {

                        ASPxClientComboBox.Cast("FFileNo").AddItem(List[i].FFileNo, List[i].FAllowanceFileID + "|" + List[i].FSource + "|" + List[i].FFileName + "|" + List[i].FFinancePropName + "|" + List[i].FFinancePropNo, "");
                        if (List[i].FFileNo == $("#hidFFileNo").val()) {
                            ASPxClientComboBox.Cast("FFileNo").SetValue(List[i].FAllowanceFileID + "|" + List[i].FSource + "|" + List[i].FFileName + "|" + List[i].FFinancePropName + "|" + List[i].FFinancePropNo);
                            FileChanged();
                        }
                    }
                }
            });

            $.ajax({
                type: 'POST',
                url: rootPath + '/AllowanceApplicationFormFront/GetFDDBRMC',
                data: { NSRDZDAH: ASPxClientComboBox.Cast("comboBox").GetValue() },
                success: function (result) {
                    fr.SetText(result);
                }
            });

        }
    </script>
    
   <style>
    .tableStyle
{
	width: 100%;
	border: solid 1px black;
		padding: 6px 5px;
	border-collapse: collapse;
}
.tableStyle td
{
}

.tableStyle .tdClass
{
	padding: 0px;
  padding: 6px 5px;
	border: solid 1px black;
}
.tableStyle th
{
	text-align: right;
	padding: 6px 5px;
	border: solid 1px black;
}
.tableStyle .button
{
	margin: 2px 0px 0px 2px;
	float: left;
}

text{border:1px solid #aecaf0;}

    </style>
</head>
<body>    @using (Html.BeginForm("Save", "AllowanceApplicationFormFront", FormMethod.Post, new { id = "form1" }))
          {
              
               @Html.DevExpress().Menu(settings =>
          {
              settings.Name = "toolBarMenu";
              settings.ItemAutoWidth = false;
              settings.Width = System.Web.UI.WebControls.Unit.Percentage(100);
              settings.Styles.Style.Border.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(0);
              settings.Styles.Style.BorderTop.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(1);
              settings.Items.Add(item =>
              {
                  item.Name = "btnSubmit";
                  item.Text = "发送";
                  item.Image.Url = Url.Content("~/Content/ControlImages/edit_add.png");
              });
              settings.Items.Add(item =>
              {
                  item.Name = "btnEdit";
                  item.Text = "清空核定金额";
                  item.Image.Url = Url.Content("~/Content/ControlImages/undo_blue.png");
              });
              settings.Items.Add(item =>
              {
                  item.Name = "btnback";
                  item.Text = "返回";
                  item.Image.Url = Url.Content("~/Content/ControlImages/back.png");
              });
              settings.ClientSideEvents.ItemClick = "function(source,e){MenuTop_emClick(source,e)}";
              settings.ItemLinkMode = ItemLinkMode.ContentBounds;
          }).GetHtml()
    <div>
 <p align=center style='text-align:center'><b><span
style='font-size:16.0pt;font-family:仿宋_GB2312'>企业专项补助资金拨付申请表</span></b></p>
<table class="tableStyle">
<tr>
<td class="tdClass" align="center" width="14%">纳税人名称<br />（加盖公章）</td>
<td colspan="3" class="tdClass" width="85%">@Html.Partial("LargeDataComboBoxPartial")
@Html.Hidden("hidNSRDZDAH","")
</td>
</tr>
<tr>
<td class="tdClass" align="center">收款账号</td>
<td  class="tdClass" width="36%"> @Html.DevExpress().ComboBox(settings =>
                             {
                                 settings.Name = "KHYH";
                                 settings.Properties.DropDownStyle = DropDownStyle.DropDownList;
                                 settings.Width = System.Web.UI.WebControls.Unit.Percentage(90);
                                 settings.Properties.TextField = "YH_MC";
                                 settings.Properties.ValueField = "YHZH";
                                 settings.Properties.ClientSideEvents.SelectedIndexChanged = "YHChanged";
                                 settings.Properties.EnableClientSideAPI = true;
                             }).GetHtml()</td>
<td class="tdClass" align="center" width="14%">账号
</td>
<td class="tdClass" width="36%">@Html.DevExpress().Label(settings =>
                           {
                               settings.Name = "YHZK";
                               settings.Text = "";
                               settings.Properties.EnableClientSideAPI = true;
                           }).GetHtml()
                   
                           </td>
</tr>
<tr>
<td class="tdClass" align="center">申请依据
</td>
<td class="tdClass" width="36%">@Html.DevExpress().ComboBox(settings =>
                                       {
                                           settings.Name = "FFileNo";
                                           settings.Properties.DropDownStyle = DropDownStyle.DropDownList;
                                           settings.Width = System.Web.UI.WebControls.Unit.Percentage(90);
                                           settings.Properties.TextField = "FFileNo";
                                           settings.Properties.ValueField = "FAllowanceFileID";
                                           settings.Properties.ClientSideEvents.SelectedIndexChanged = "FileChanged";
                                           settings.Properties.EnableClientSideAPI = true;

                                       }).GetHtml()</td>
<td class="tdClass" align="center" width="14%">资金性质
</td>
<td class="tdClass">
@Html.DevExpress().Label(settings =>
{
    settings.Name = "FFinancePropName";
    settings.Text = "";
    settings.Properties.EnableClientSideAPI = true;
}).GetHtml()
</td>
</tr>
<tr>
<td class="tdClass" align="center">备<span lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>注

</td>
<td colspan="3" class="tdClass">@Html.DevExpress().TextBox(settings =>
                           {
                               settings.Name = "FNote";
                               settings.Width = System.Web.UI.WebControls.Unit.Percentage(90);
                               settings.Text = "";
                           }).GetHtml()</td>
</tr>
<tr>
<td colspan="2" class="tdClass" align="center">企业申请资金
</td>
<td colspan="2" class="tdClass" align="center">财政核定资金
</td>
</tr>
<tr>
<td colspan="2" class="tdClass" align="left" width="25%">

<table  width="99%">
<tr>
<td align="right"  style=" width:40px">金额:</td>
<td align="left">@Html.DevExpress().Label(settings =>
             {
                 settings.Name = "FApplyAmount";
                 settings.Properties.EnableClientSideAPI = true;
                 settings.Text = "";
             }).GetHtml()</td>

             @Html.Hidden("hidFApplyAmount","")
</tr>
</table>
</td>
<td colspan="2"  class="tdClass" align="left" width="50%">

<table  width="99%">
<tr>
<td align="right"  style=" width:40px">金额:</td>
<td align="left">@Html.DevExpress().Label(settings =>
             {
                 settings.Name = "FAuditAmount";
                 settings.Properties.EnableClientSideAPI = true;
                 settings.Text = "";
             }).GetHtml()
                  @Html.Hidden("hidFAuditAmount", "")
             </td>
</tr>
</table>
</td>
</tr>
<tr>
<td  class="tdClass" align="left" width="50%" colspan='2'>
<table  width="99%">
<tr>
<td align="right" style=" width:40px">大写:</td>
<td align="left">
@Html.DevExpress().Label(settings =>
{
    settings.Name = "FApplyAmountDX";
    settings.Properties.EnableClientSideAPI = true;
    settings.Text = "";
}).GetHtml()</td>
</tr>
</table></td>
<td  class="tdClass" align="left" width="50%" colspan='2'>
<table  width="99%">
<tr>
<td align="right" style=" width:40px">大写:</td>
<td align="left">
@Html.DevExpress().Label(settings =>
{
    settings.Name = "FAuditAmountDX";
    settings.Properties.EnableClientSideAPI = true;
    settings.Text = "";
}).GetHtml()</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2"  class="tdClass" align="left">
<table width="99%">
<tr>
<td  width="25%">
<span style='font-size:10.0pt;font-family:仿宋_GB2312'>企业法人:</span>
</td>
<td  width="75%">
 @Html.DevExpress().TextBox(settings =>
{
    settings.Name = "fr";
    settings.Width = System.Web.UI.WebControls.Unit.Percentage(99);
    settings.Text = "";
}).GetHtml()
</td>
</tr>
<tr>
<td  width="25%">
<span style='font-size:10.0pt;font-family:仿宋_GB2312'>经办人:</span>
</td>
<td  width="75%">
 @Html.DevExpress().TextBox(settings =>
{
    settings.Name = "FApplyName";
    settings.Width = System.Web.UI.WebControls.Unit.Percentage(99);
    settings.Text = "";
}).GetHtml()
</td>
</tr>
<tr>
<td  width="25%">
<span style='font-size:10.0pt;font-family:仿宋_GB2312'>日期:</span>
</td>
<td  width="75%">
@DateTime.Now.ToString("yyyy年MM月dd日")
</td>
</tr>
</table></td>
<td colspan="2"  class="tdClass" align="left"><p><span style='font-size:10.0pt;font-family:仿宋_GB2312'>处室负责人：<span
  lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;</span></span></p>
        <p><span style='font-size:10.0pt;font-family:仿宋_GB2312'>经办人：</span></p>
        <p><span style='font-size:10.0pt;font-family:仿宋_GB2312'>日期：<span
  lang=EN-US>&nbsp; &nbsp;&nbsp;&nbsp;</span>年 &nbsp;&nbsp;月<span lang=EN-US>&nbsp;
          &nbsp;</span>日</span></p></td>
</tr>
</table>

    </div>
     @Html.Hidden("hdjsAlert", (ViewData["jsAlert"]))
              @Html.Hidden("hidisshowje", ViewData["isshowje"])
      @Html.Hidden("hdFApplicationFormID", (ViewData["FApplicationFormID"]))
              @Html.Hidden("hidNSRDZDAH2", ViewData["NSRDZDAH"])
      @Html.Hidden("hidFFileNo", ViewData["FFileNo"])
         @Html.Hidden("hidNSRDZDAH3", ViewData["NSRDZDAH2"])
 
    
   
          }

              <div style=" visibility:hidden">
         @Html.Partial("AllowanceApplicationFormFrontPrintPartial")  
         </div>
</body>
</html>
